fix: update TestMCPGSupportsIntegrityReactions for MCPG v0.2.19 default#26091
fix: update TestMCPGSupportsIntegrityReactions for MCPG v0.2.19 default#26091
Conversation
There was a problem hiding this comment.
Pull request overview
Updates failing/incorrect test expectations for the MCPG integrity-reactions version gate now that the default MCP Gateway version is v0.2.19 (>= the minimum v0.2.18).
Changes:
- Adjusts
TestMCPGSupportsIntegrityReactionsexpectations for nil/empty gateway config to expect support (true) given the new default version. - Updates test case names/comments to reflect the current default MCPG version behavior.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/tools_validation_test.go |
Updates MCPG integrity-reactions support test cases to match the new default gateway version behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
| name: "nil gateway config uses default (v0.2.19, above min)", | ||
| gatewayConfig: nil, | ||
| // DefaultMCPGatewayVersion = "v0.2.17" < MCPGIntegrityReactionsMinVersion = "v0.2.18" | ||
| want: false, | ||
| // DefaultMCPGatewayVersion = "v0.2.19" >= MCPGIntegrityReactionsMinVersion = "v0.2.18" | ||
| want: true, |
There was a problem hiding this comment.
The test names/comments hardcode the current DefaultMCPGatewayVersion (v0.2.19). This has already drifted once when the default version was bumped, and it will drift again on the next bump. Consider making these names/comments version-agnostic (e.g., “uses default (above/below min)”) or constructing the name via fmt.Sprintf using constants.DefaultMCPGatewayVersion so it stays accurate without manual updates.
Compute the expected result for nil/empty gateway config test cases dynamically from DefaultMCPGatewayVersion and MCPGIntegrityReactionsMinVersion so the test doesn't break every time the default MCPG version is bumped.
Problem
The MCPG version bump from v0.2.17 to v0.2.19 (#26071) didn't update the integrity-reactions test expectations added in #25948. The
DefaultMCPGatewayVersionis nowv0.2.19which is>= MCPGIntegrityReactionsMinVersion (v0.2.18), so the nil/empty gateway config test cases should expecttrue(supported) instead offalse.Fix
Updated two test cases in
TestMCPGSupportsIntegrityReactions:nil gateway config uses default:want: false→want: trueempty version uses default:want: false→want: trueUpdated test names and comments to reflect the current default version.